{extend name="public:layout" /}
{block name="title"}退款订单管理{/block}
{block name="head"}
<style>
    i{cursor:pointer}
</style>
{/block}
{block name="body"}
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><i class="fa fa-hand-o-right"></i> 订单列表</li>
            </ol>
        </div>
        <div class="ibox-content">
            <div class="toolbar">
                <div class="pull-left">
                    <button type="button" onclick="CheckAll();" class="btn btn-white">全</button>
                    <button type="button" onclick="CheckOther();" class="btn btn-white">反</button>
                    <button type="button" onclick="batchDel(CheckboxValue())" class="btn btn-danger">
                        <i class="fa fa-trash"></i> 批量删除
                    </button>
                </div>
                <div class="pull-right">
                    <form class="form-inline" method="post">
                        <div class="form-group">
                            <div class="input-group">
                                <input class="form-control" type="text" placeholder="请输入订单编号"
                                       name="order_sn" value="{$query.order_sn}"/>
                            </div>
                        </div>
                        <button type="submit" class="btn btn-info">
                            <i class="fa fa-search"></i> 搜索
                        </button>
                        <a class="btn btn-white" href="{:url('index',['mid'=>$Request.param.mid])}">
                            <i class="fa fa-trash"></i> 清空
                        </a>
                    </form>
                </div>
                <div class="clearfix"></div>
            </div>
            <ul class="nav nav-tabs" id="tab_search">
                <li {eq name="query.order_genre" value="0"}class="active"{/eq}><a href="{:url('index',['order_genre'=>0])}">所有退款订单</a></li>
                <li {eq name="query.order_genre" value="1"}class="active"{/eq}><a href="{:url('index',['order_genre'=>1])}">待审核</a></li>
                <li {eq name="query.order_genre" value="2"}class="active"{/eq}><a href="{:url('index',['order_genre'=>2])}">不同意</a></li>
                <li {eq name="query.order_genre" value="3"}class="active"{/eq}><a href="{:url('index',['order_genre'=>3])}">已完成</a></li>
            </ul>
            <table class="table table-condensed table-hover" id="grid">
                <thead>
                <tr>
                    <th width="50">#</th>
                    <th>订单编号</th>
                    <th>买家</th>
                    <th>退款金额</th>
                    <th>退款方式</th>
                    <th>处理状态</th>
                    <th width="90">操作</th>
                </tr>
                </thead>
                <tbody>
                {volist name="list" id="vo"}
                <tr>
                    <td>
                        <input name="refund_id[]" type="checkbox" class="checkbox" value="{$vo.refund_id}" />
                    </td>
                    <td>
                        {$vo.order_sn}
                    </td>
                    <td>
                        {$vo['buyer_username']}
                    </td>
                    <td>
                        {$vo['refund_amount']}
                    </td>
                    <td>
                        {$vo['refund_type_text']}
                    </td>
                    <td>
                        {$vo['seller_status_text']}
                    </td>
                    <td>
                        <a href="javascript:;" onclick="showDetail(this)" data-url="{:url('ShopOrder/orderDetail',['order_sn'=>$vo['order_sn']])}">查看订单</a><br/>
                        {if condition="($vo['refund_status'] == 1)"}
                        <a href="{:url('edit',['refund_id'=>$vo['refund_id']])}">处理退款</a><br/>
                        <a href="javascript:;" onclick="doAction(this);"
                           data-msg="确认删除吗？" data-url="{:url('del')}"
                           data-params="refund_id={$vo.refund_id}">删除退款单</a>
                        {/if}
                    </td>
                </tr>
                {/volist}
                </tbody>
            </table>
            <div class="page-bar">{$list->render()}</div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    //显示订单详情
    function showDetail(obj) {
        var url = $(obj).data('url');
        openDialog('订单详情', url, '800px', '520px');
    }
</script>
{/block}